//
//  MadMultiThreadedDatabaseLoader.h
//  MadGTD
//
//  Created by Fuzhou Chen on 7/29/12.
//  Copyright (c) 2012 Fuzhou Chen. All rights reserved.
//

#import <Foundation/Foundation.h>
#include <pthread.h>
#include "MadDatabase.h"

#define MAD_DB_LOADED_NOTIFY @"MadDBLoadedNotification"

@interface MadGTDModel : NSObject
{
    pthread_t    _loaderThread;
    bool         _isDbLoaded;
    NSString*    _dbName;
    NSString*    _dbPath;
    MadDatabase* _db;
}

-(id)initWithDbInDocuments:(NSString*)docName;
-(void)asyncLoadDb;
-(void)syncLoadDb;

@property(readonly, nonatomic) NSString* dbName;
@property(readonly, nonatomic) NSString* dbPath;
@property(readonly, nonatomic) bool isDbLoaded;

@end
